﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace Wms.Manager.Wms
{
    public class InventoryManagement : FullAuditedAggregateRoot<Guid>//, IMultiTenant
    {

        /// <summary>
        /// 自增id'
        /// </summary>
        
        public long IdentityId { get; set; }

        /// <summary>
        /// 存货名称
        /// </summary>
        [StringLength(50)]
        public string InventoryName { get; set; }

        /// <summary>
        /// 现存数量
        /// </summary>
        public int CurrentQuantity { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [StringLength(200)]
        public string BatchNumber { get; set; }

        /// <summary>
        /// 货位名称
        /// </summary>
        [StringLength(200)]
        public string LocationName { get; set; }

        /// <summary>
        /// 租户ID
        /// </summary>
        // public Guid? TenantId { get; set; }

        [StringLength(500)]
        public string? Remark { get; set; }


        protected InventoryManagement()
        {
        }

        public InventoryManagement(
            Guid id,
            string inventoryName,
            int currentQuantity,
            string batchNumber,
            string locationName,
            string remark=null
        ) : base(id)
        {
            Check.NotNullOrWhiteSpace(inventoryName, nameof(inventoryName));
            Check.NotNullOrWhiteSpace(batchNumber, nameof(batchNumber));
            Check.NotNullOrWhiteSpace(locationName, nameof(locationName));
            Check.Range(currentQuantity, nameof(currentQuantity), 0, int.MaxValue);

            InventoryName = inventoryName;
            CurrentQuantity = currentQuantity;
            BatchNumber = batchNumber;
            LocationName = locationName;
            //TenantId = tenantId;
            Remark = remark;
        }
    }
}
